<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Conf\ConfModel;

use Srv\Libs\Frame\Conf;

final class ConfExt
{
    private static ?JVerifyConf $JVerifyConf                        = null;     // JVerifyConf
    private static ?JPushConf $JPushConf                            = null;     // JPushConf
    private static ?WPushConf $WPushConf                            = null;     // WPushConf
    private static ?SignInConfGroup $SignInConfGroup                = null;     // SignInConfGroup
    private static ?StorageConfGroup $StorageConfGroup              = null;     // StorageConfGroup
    private static ?SmsConfGroup $SmsConfGroup                      = null;     // SmsConfGroup
    private static ?EmailConfGroup $EmailConfGroup                  = null;     // EmailConfGroup
    private static ?PayAlipayConfGroup $PayAlipayConfGroup          = null;     // PayAlipayConfGroup
    private static ?PayWeChatConfGroup $PayWeChatConfGroup          = null;     // PayWeChatConfGroup
    private static ?PayAppleConfGroup $PayAppleConfGroup            = null;     // PayAppleConfGroup
    private static ?PayPayPalConfGroup $PayPayPalConfGroup          = null;     // PayPayPalConfGroup
    private static ?PayGooglePayConfGroup $PayGooglePayConfGroup    = null;     // PayGooglePayConfGroup
    private static ?PayStripeConfGroup $PayStripeConfGroup          = null;     // PayStripeConfGroup
    private static ?AppleAuthConfGroup $AppleAuthConfGroup          = null;     // AppleAuthConfGroup
    private static ?GPlayAuthConfGroup $GPlayAuthConfGroup          = null;     // GPlayAuthConfGroup

    /**
     * @return JVerifyConf
     * getJVerifyConf
     */
    public static function getJVerifyConf():JVerifyConf
    {
        if(self::$JVerifyConf instanceof JVerifyConf) return self::$JVerifyConf;
        self::$JVerifyConf              = new JVerifyConf(Conf::getGroupList(JVerifyConf::PREFIX, false, true));
        return self::$JVerifyConf;
    }

    /**
     * @return JPushConf
     * getJPushConf
     */
    public static function getJPushConf():JPushConf
    {
        if(self::$JPushConf instanceof JPushConf) return self::$JPushConf;
        self::$JPushConf                = new JPushConf(Conf::getGroupList(JPushConf::PREFIX, false, true));
        return self::$JPushConf;
    }

    /**
     * @return WPushConf
     * getWPushConf
     */
    public static function getWPushConf():WPushConf
    {
        if(self::$WPushConf instanceof WPushConf) return self::$WPushConf;
        self::$WPushConf                = new WPushConf(Conf::getGroupList(WPushConf::PREFIX, false, true));
        return self::$WPushConf;
    }

    /**
     * @return SignInConfGroup
     * getSignInConfGroup
     */
    public static function getSignInConfGroup():SignInConfGroup
    {
        if(self::$SignInConfGroup instanceof SignInConfGroup) return self::$SignInConfGroup;
        self::$SignInConfGroup         = new SignInConfGroup();
        return self::$SignInConfGroup;
    }

    /**
     * @return StorageConfGroup
     * getStorageConfGroup
     */
    public static function getStorageConfGroup():StorageConfGroup
    {
        if(self::$StorageConfGroup instanceof StorageConfGroup) return self::$StorageConfGroup;
        self::$StorageConfGroup         = new StorageConfGroup();
        return self::$StorageConfGroup;
    }

    /**
     * @return SmsConfGroup
     * getSmsConfGroup
     */
    public static function getSmsConfGroup():SmsConfGroup
    {
        if(self::$SmsConfGroup instanceof SmsConfGroup) return self::$SmsConfGroup;
        self::$SmsConfGroup             = new SmsConfGroup();
        return self::$SmsConfGroup;
    }

    /**
     * @return EmailConfGroup
     * getEmailConfGroup
     */
    public static function getEmailConfGroup():EmailConfGroup
    {
        if(self::$EmailConfGroup instanceof EmailConfGroup) return self::$EmailConfGroup;
        self::$EmailConfGroup           = new EmailConfGroup();
        return self::$EmailConfGroup;
    }

    /**
     * @return PayAlipayConfGroup
     * getPayAlipayConfGroup
     */
    public static function getPayAlipayConfGroup():PayAlipayConfGroup
    {
        if(self::$PayAlipayConfGroup instanceof PayAlipayConfGroup) return self::$PayAlipayConfGroup;
        self::$PayAlipayConfGroup       = new PayAlipayConfGroup();
        return self::$PayAlipayConfGroup;
    }

    /**
     * @return PayWeChatConfGroup
     * getPayWeChatConfGroup
     */
    public static function getPayWeChatConfGroup():PayWeChatConfGroup
    {
        if(self::$PayWeChatConfGroup instanceof PayWeChatConfGroup) return self::$PayWeChatConfGroup;
        self::$PayWeChatConfGroup       = new PayWeChatConfGroup();
        return self::$PayWeChatConfGroup;
    }

    /**
     * @return PayAppleConfGroup
     * getPayAppleConfGroup
     */
    public static function getPayAppleConfGroup():PayAppleConfGroup
    {
        if(self::$PayAppleConfGroup instanceof PayAppleConfGroup) return self::$PayAppleConfGroup;
        self::$PayAppleConfGroup        = new PayAppleConfGroup();
        return self::$PayAppleConfGroup;
    }

    /**
     * @return PayPayPalConfGroup
     * getPayPayPalConfGroup
     */
    public static function getPayPayPalConfGroup():PayPayPalConfGroup
    {
        if(self::$PayPayPalConfGroup instanceof PayPayPalConfGroup) return self::$PayPayPalConfGroup;
        self::$PayPayPalConfGroup       = new PayPayPalConfGroup();
        return self::$PayPayPalConfGroup;
    }

    /**
     * @return PayGooglePayConfGroup
     * getPayGooglePayConfGroup
     */
    public static function getPayGooglePayConfGroup():PayGooglePayConfGroup
    {
        if(self::$PayGooglePayConfGroup instanceof PayGooglePayConfGroup) return self::$PayGooglePayConfGroup;
        self::$PayGooglePayConfGroup    = new PayGooglePayConfGroup();
        return self::$PayGooglePayConfGroup;
    }

    /**
     * @return PayStripeConfGroup
     * getPayStripeConfGroup
     */
    public static function getPayStripeConfGroup():PayStripeConfGroup
    {
        if(self::$PayStripeConfGroup instanceof PayStripeConfGroup) return self::$PayStripeConfGroup;
        self::$PayStripeConfGroup       = new PayStripeConfGroup();
        return self::$PayStripeConfGroup;
    }

    /**
     * @return AppleAuthConfGroup
     * getAppleAuthConfGroup
     */
    public static function getAppleAuthConfGroup():AppleAuthConfGroup
    {
        if(self::$AppleAuthConfGroup instanceof AppleAuthConfGroup) return self::$AppleAuthConfGroup;
        self::$AppleAuthConfGroup       = new AppleAuthConfGroup();
        return self::$AppleAuthConfGroup;
    }

    /**
     * @return GPlayAuthConfGroup
     * getGPlayAuthConfGroup
     */
    public static function getGPlayAuthConfGroup():GPlayAuthConfGroup
    {
        if(self::$GPlayAuthConfGroup instanceof GPlayAuthConfGroup) return self::$GPlayAuthConfGroup;
        self::$GPlayAuthConfGroup       = new GPlayAuthConfGroup();
        return self::$GPlayAuthConfGroup;
    }
}